from sqlalchemy.orm import Session
from ..models.asphalt import AsphaltMixingData
from ..schemas.asphalt import AsphaltMixingDataCreate

def create_asphalt_data(db: Session, data: AsphaltMixingDataCreate) -> AsphaltMixingData:
    db_data = AsphaltMixingData(**data)
    db.add(db_data)
    db.commit()
    db.refresh(db_data)
    return db_data

def get_asphalt_data(db: Session, data_id: int) -> AsphaltMixingData:
    return db.query(AsphaltMixingData).filter(AsphaltMixingData.id == data_id).first()